// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
/*eslint-disable*/
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import qs from 'qs'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import FastClick from 'fastclick'
import '../static/js/flexible.js'
import common from './common/common'    //从地址栏获取token，移动端页面会传token

// router.beforeEach((to, from, next) => {
//   let token = common.getStorage('token')
//   if (token) {
//     if (to.path !== '/login') {
//       next()
//     } else {
//       // next()
//     }
//   } else {
//     if (to.matched.some(record => record.meta.require)) {
//       common.setStorage('fullPath', to.fullPath)
//       next(`/login`)
//     } else {
//       next()
//     }
//   }
// })


Vue.use(VueAwesomeSwiper)
Vue.config.productionTip = false
Vue.prototype.$axios = axios
Vue.prototype.$qs = qs;
Vue.prototype.COMMON = common
FastClick.attach(document.body)
common.getUrlToken()

const that = new Vue({
  router,
  render: h=>h(App)
}).$mount('#app');

export default that;

